Skip to content

Conversation

@J-Sek
Copy link
Contributor

@J-Sek J-Sek commented Apr 26, 2025

Description

  • new prop to progressively expand nodes to display current selection
  • note: expand animation can sometimes glitch and seems to need additional 100ms when the feature is used on VTreeview

closes #16578

Markup:

<template>
  <v-app theme="dark">
    <v-container class="d-flex ga-6 align-start">
      <v-card class="mx-auto" width="300">
        <v-btn color="primary" text="reload" @click="reload" />
        <v-list
          :key="reload1"
          v-model:opened="opened1"
          v-model:selected="selected1"
          :items="items"
          select-strategy="independent"
          auto-reveal-selected
          item-props
        />
      </v-card>
      <v-card class="mx-auto" width="300">
        <v-btn
          color="primary"
          text="apply selection"
          @click="selected2 = [222, 34]"
        />
        <v-treeview
          v-model:opened="opened2"
          v-model:selected="selected2"
          :items="items"
          auto-reveal-delay="400"
          select-strategy="independent"
          auto-reveal-selected
          item-props
          selectable
        />
      </v-card>
    </v-container>
  </v-app>
</template>

<script setup>
  import { ref } from 'vue'

  const selected1 = [221, 32]
  const reload1 = ref(0)
  function reload () {
    opened1.value = []
    reload1.value++
  }
  const selected2 = ref([])
  const opened1 = ref([])
  const opened2 = ref([])
  const items = [
    { value: 1, title: 'Home', prependIcon: 'mdi-home' },
    {
      value: 2,
      title: 'Admin',
      prependIcon: 'mdi-numeric-1-box-outline',
      children: [
        {
          value: 21,
          title: 'Management',
          prependIcon: 'mdi-account-multiple-outline',
        },
        {
          value: 22,
          title: 'Settings',
          prependIcon: 'mdi-cog-outline',
          children: [
            { value: 221, title: 'General', prependIcon: 'mdi-tools' },
            { value: 222, title: 'Security', prependIcon: 'mdi-security' },
          ],
        },
      ],
    },
    {
      value: 3,
      title: 'Actions',
      prependIcon: 'mdi-numeric-2-box-outline',
      children: [
        { value: 31, title: 'Create', prependIcon: 'mdi-plus-outline' },
        { value: 32, title: 'Read', prependIcon: 'mdi-file-outline' },
        { value: 33, title: 'Update', prependIcon: 'mdi-update' },
        { value: 34, title: 'Delete', prependIcon: 'mdi-delete' },
      ],
    },
  ]
</script>

@J-Sek J-Sek added the E: nested Nested composable label Apr 26, 2025
@J-Sek J-Sek self-assigned this Apr 26, 2025
@J-Sek J-Sek force-pushed the feat/nested-progressive-reveal branch from caccae2 to 795eeee Compare April 26, 2025 19:41
@J-Sek J-Sek added the T: feature A new feature label Apr 26, 2025
@J-Sek J-Sek force-pushed the feat/nested-progressive-reveal branch from 795eeee to 22c8a29 Compare May 15, 2025 23:34
@J-Sek J-Sek requested a review from a team May 15, 2025 23:43
@J-Sek J-Sek changed the title feat(nested): reveal selected items feat(nested): auto-reveal selected items May 15, 2025
@johnleider johnleider requested review from Copilot and ikushum and removed request for a team May 16, 2025 17:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces an auto-reveal feature for nested components to progressively expand nodes showing the current selection.

  • Adds new props (autoRevealSelected and autoRevealDelay) to control the auto-reveal behavior
  • Implements an autoReveal function using a layered reveal approach with configurable delay

@J-Sek J-Sek force-pushed the feat/nested-progressive-reveal branch from 22c8a29 to a14b83c Compare July 9, 2025 12:50
@J-Sek J-Sek added the S: maybe Functionality that we are considering label Jul 29, 2025
@KaelWD KaelWD force-pushed the dev branch 2 times, most recently from 6331ca7 to 564ccc8 Compare September 10, 2025 13:29
@J-Sek J-Sek force-pushed the dev branch 3 times, most recently from a7fa817 to 2e2cddb Compare October 8, 2025 15:22
@J-Sek J-Sek added this to the v3.x.x milestone Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

E: nested Nested composable S: maybe Functionality that we are considering T: feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant